#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	int x, n, y, i;
	scanf("%d %d", &x, &n);
	for (i = 1; i <= n; i++)
	{
		if (x == 6 || x == 7)
		{
			n -= 1;
		}
		x++;
	}
	y = 250 * n;
	printf("%d", y);

	return 0;
}
